package ch03_test;

public class Demo2_2 {
	public static void main(String[] args) {
		int i, j;
		for (i = -3; i <= 3; i++) {

			for (j = 1; j <= Math.abs(i); j++) // Math.abs(i)为求i的绝对值

				System.out.print(" "); // 打印1个空格

			for (j = 1; j <= 4 - Math.abs(i); j++) {

				System.out.print(" *"); // 打印1个空格和1个*

			}

			System.out.println();

		}

	}
}
